package com.freight.core.config.security;

import com.freight.core.common.aop.DecodeMethodParaResolver;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.List;

@Slf4j
@Configuration
public class WebSecretConfig implements WebMvcConfigurer {
    //region 注册自定义HandlerMethodArgumentResolver
    @Override
    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers) {
        resolvers.add(decodeStrResolver());
    }

    @Bean
    public DecodeMethodParaResolver decodeStrResolver() {
        return new DecodeMethodParaResolver();
    }
    //endregion
}